priv->show_preview_entry = show != FALSE;
}
-static gchar *
-gtk_font_button_font_chooser_get_font (GtkFontChooser *chooser)
-{
- GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
-
- return g_strdup (gtk_font_button_get_font_name (font_button));
-}
-
-static void
-gtk_font_button_font_chooser_set_font (GtkFontChooser *chooser,
- const gchar *fontname)
-{
- GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
-
- gtk_font_button_set_font_name (font_button, fontname);
-}
-
static PangoFontFamily *
gtk_font_button_font_chooser_get_font_family (GtkFontChooser *chooser)
{
static void
gtk_font_button_font_chooser_iface_init (GtkFontChooserIface *iface)
{
- iface->get_font = gtk_font_button_font_chooser_get_font;
- iface->set_font = gtk_font_button_font_chooser_set_font;
iface->get_font_family = gtk_font_button_font_chooser_get_font_family;
iface->get_font_face = gtk_font_button_font_chooser_get_font_face;
iface->get_font_size = gtk_font_button_font_chooser_get_font_size;
gchar *
gtk_font_chooser_get_font (GtkFontChooser *fontchooser)
{
+ gchar *fontname;
+
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
- return GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->get_font (fontchooser);
+ g_object_get (fontchooser, "font", &fontname, NULL);
+
+
+ return fontname;
}
/**
g_return_if_fail (GTK_IS_FONT_CHOOSER (fontchooser));
g_return_if_fail (fontname != NULL);
- GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->set_font (fontchooser,
- fontname);
+ g_object_set (fontchooser, "font", fontname, NULL);
}
/**
GTypeInterface base_iface;
/* Methods */
- gchar * (* get_font) (GtkFontChooser *chooser);
- void (* set_font) (GtkFontChooser *chooser,
- const gchar *fontname);
PangoFontFamily * (* get_font_family) (GtkFontChooser *chooser);
PangoFontFace * (* get_font_face) (GtkFontChooser *chooser);
gint (* get_font_size) (GtkFontChooser *chooser);
+
void (* set_filter_func) (GtkFontChooser *chooser,
GtkFontFilterFunc filter,
gpointer data,
GTK_FONT_CHOOSER_DELEGATE_QUARK);
}
-static gchar *
-delegate_get_font (GtkFontChooser *chooser)
-{
- return gtk_font_chooser_get_font (get_delegate (chooser));
-}
-
-static void
-delegate_set_font (GtkFontChooser *chooser,
- const gchar *fontname)
-{
- gtk_font_chooser_set_font (get_delegate (chooser), fontname);
-}
-
static PangoFontFamily *
delegate_get_font_family (GtkFontChooser *chooser)
{
void
_gtk_font_chooser_delegate_iface_init (GtkFontChooserIface *iface)
{
- iface->get_font = delegate_get_font;
- iface->set_font = delegate_set_font;
iface->get_font_family = delegate_get_font_family;
iface->get_font_face = delegate_get_font_face;
iface->get_font_size = delegate_get_font_size;
static void
gtk_font_chooser_widget_iface_init (GtkFontChooserIface *iface)
{
- iface->get_font = gtk_font_chooser_widget_get_font;
- iface->set_font = gtk_font_chooser_widget_set_font;
iface->get_font_family = gtk_font_chooser_widget_get_family;
iface->get_font_face = gtk_font_chooser_widget_get_face;
iface->get_font_size = gtk_font_chooser_widget_get_size;